﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.ServiceModel.Syndication;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;

namespace ASP.NETWebFormTutorial
{
    public partial class MusicFeed : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            WebRequest rssRequst = WebRequest.Create("http://dvd.netflix.com/Top25RSS?gid=2310");

            WebResponse rssResponse = rssRequst.GetResponse();

            XmlReader reader = XmlReader.Create(rssResponse.GetResponseStream());

            var feed = SyndicationFeed.Load(reader);

            foreach (var item in feed.Items)
            {
                mainDiv.InnerHtml += "<div>" + item.Summary.Text + "</div>";
            }
        }
    }

}